package com.gdwstudy.innerclass;

/**
 * 匿名内部类直接作为参数
 */
public class Test {
    public static void main(String[] args) {
        Cellphone cellphone = new Cellphone();
        cellphone.alarmcolck(new Bell(){
            @Override
            public void ring() {
                System.out.println("懒猪起床了...");
            }
        });
        cellphone.alarmcolck(new Bell(){
            @Override
            public void ring() {
                System.out.println("小伙上课了...");
            }
        });
    }
}
